(* Copyright Per Lindgren 2014, see the file "LICENSE" *)
(* for the full license governing this code.           *)

(* RTFM-core/IsrVector *)

type isr_type =
  | K (* reserved by the RTFM kernel                *)
  | R (* reserved by ARM                            *) 
  | O (* overridable but has default implementation *)
  | F (* free to use by the application             *)
  | U (* used by the application                    *)
    
let isr_vector = [
    (* Core Level - CM3 *)
    (K, "&_vStackTop");                            (* The initial stack pointer *)
    (K, "ResetISR");                               (* The reset handler *)
    (O, "NMI_Handler");                            (* The NMI handler *)
    (O, "HardFault_Handler");                      (* The hard fault handler *)
    (O, "MemManage_Handler");                      (* The MPU fault handler *)
    (O, "BusFault_Handler");                       (* The bus fault handler *)
    (O, "UsageFault_Handler");                     (* The usage fault handler *)
    (R, "0");                                      (* Reserved *)
    (R, "0");                                      (* Reserved *)
    (R, "0");                                      (* Reserved *)
    (R, "0");                                      (* Reserved *)
    (O, "SVC_Handler");                            (* SVCall handler *)
    (O, "DebugMon_Handler");                       (* Debug monitor handler *)
    (R, "0");                                      (* Reserved *)
    (O, "PendSV_Handler");                         (* The PendSV handler *)
    (O, "SysTick_Handler");                        (* The SysTick handler *)

    (* Chip Level - LPC17 *)
    (F, "WDT_IRQHandler");                         (* 16; 0x40 - WDT *)
    (F, "TIMER0_IRQHandler");                      (* 17; 0x44 - TIMER0 *)
    (F, "TIMER1_IRQHandler");                      (* 18; 0x48 - TIMER1 *)
    (F, "TIMER2_IRQHandler");                      (* 19; 0x4c - TIMER2 *)
    (F, "TIMER3_IRQHandler");                      (* 20; 0x50 - TIMER3 *)
    (F, "UART0_IRQHandler");                       (* 21; 0x54 - UART0 *)
    (F, "UART1_IRQHandler");                       (* 22; 0x58 - UART1 *)
    (F, "UART2_IRQHandler");                       (* 23; 0x5c - UART2 *)
    (F, "UART3_IRQHandler");                       (* 24; 0x60 - UART3 *)
    (F, "PWM1_IRQHandler");                        (* 25; 0x64 - PWM1 *)
    (F, "I2C0_IRQHandler");                        (* 26; 0x68 - I2C0 *)
    (F, "I2C1_IRQHandler");                        (* 27; 0x6c - I2C1 *)
    (F, "I2C2_IRQHandler");                        (* 28; 0x70 - I2C2 *)
    (F, "SPI_IRQHandler");                         (* 29; 0x74 - SPI *)
    (F, "SSP0_IRQHandler");                        (* 30; 0x78 - SSP0 *)
    (F, "SSP1_IRQHandler");                        (* 31; 0x7c - SSP1 *)
    (F, "PLL0_IRQHandler");                        (* 32; 0x80 - PLL0 (Main PLL) *)
    (F, "RTC_IRQHandler");                         (* 33; 0x84 - RTC *)
    (F, "EINT0_IRQHandler");                       (* 34; 0x88 - EINT0 *)
    (F, "EINT1_IRQHandler");                       (* 35; 0x8c - EINT1 *)
    (F, "EINT2_IRQHandler");                       (* 36; 0x90 - EINT2 *)
    (F, "EINT3_IRQHandler");                       (* 37; 0x94 - EINT3 *)
    (F, "ADC_IRQHandler");                         (* 38; 0x98 - ADC *)
    (F, "BOD_IRQHandler");                         (* 39; 0x9c - BOD *)
    (F, "USB_IRQHandler");                         (* 40; 0xA0 - USB *)
    (F, "CAN_IRQHandler");                         (* 41; 0xa4 - CAN *)
    (F, "DMA_IRQHandler");                         (* 42; 0xa8 - GP DMA *)
    (F, "I2S_IRQHandler");                         (* 43; 0xac - I2S *)
    (F, "ETH_IRQHandler");                         (* 44; 0xb0 - Ethernet *)
    (F, "RIT_IRQHandler");                         (* 45; 0xb4 - RITINT *)
    (F, "MCPWM_IRQHandler");                       (* 46; 0xb8 - Motor Control PWM *)
    (F, "QEI_IRQHandler");                         (* 47; 0xbc - Quadrature Encoder *)
    (F, "PLL1_IRQHandler");                        (* 48; 0xc0 - PLL1 (USB PLL) *)
    (F, "USBActivity_IRQHandler");                 (* 49; 0xc4 - USB Activity interrupt to wakeup *)
    (F, "CANActivity_IRQHandler");                 (* 50; 0xc8 - CAN Activity interrupt to wakeup *)
]
    
let isr_maxpri = 32

      
